UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jn/BPEErPJPEtKzJDHpcWYFWZ05jlm6q4UazADhJvK8=' 
WHERE 
  key_id = '035f17c35696baad80c12cd2398b652690d2aea5f8f6d50526ef21cd0ea2a2b6' 
  AND (
    token = 'Jn/BPEErPJPEtKzJDHpcWYFWZ05jlm6q4UazADhJvK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032