UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dQYin6H9T84OpsKOQcNYlH3lefbJfp7Io/RfWGP0cAE=' 
WHERE 
  key_id = '5e27aba219b470bbc3c5fbfc8000dc39c0d736227c80d59c81a564f8af9c3792' 
  AND (
    token = 'dQYin6H9T84OpsKOQcNYlH3lefbJfp7Io/RfWGP0cAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030