UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gi6uYGQYV0FaLWYzFpQ0oZpRxCnWc96NUSHGKvXHklo=' 
WHERE 
  key_id = 'bc1eaba9455d24f47c70bdc381c3c25a6bd023c55ed667ce766029bd71e2e25e' 
  AND (
    token = 'Gi6uYGQYV0FaLWYzFpQ0oZpRxCnWc96NUSHGKvXHklo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020