UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+0rFVQIMKZtuhCBTODAhFTiQTa5UHu/Bv8/CoNQmdJ4=' 
WHERE 
  key_id = '34e6a8a2a89cc17877655c384c86d6af6a9651da55b0c905ad9966ee0cbc723d' 
  AND (
    token = '+0rFVQIMKZtuhCBTODAhFTiQTa5UHu/Bv8/CoNQmdJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061