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

Query time 0.00015