UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ocz9bq9Jiw/TZ7sYs23Mh0KRMnK3zuI9MPXnMoQvzuc=' 
WHERE 
  key_id = 'ed31453b394d0272e7dc3ac71be3498a97261abac911426e71001e1eb33dec7a' 
  AND (
    token = 'Ocz9bq9Jiw/TZ7sYs23Mh0KRMnK3zuI9MPXnMoQvzuc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025