UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PYT0G7kIqmdc9eN5hxyTXSVt8/YkhtxE0RPst8oEJzs=' 
WHERE 
  key_id = '84c81ebd6fd5ef2db659fcc275856cb3bb14f970d7a2b0b928d31c66f2e849f4' 
  AND (
    token = 'PYT0G7kIqmdc9eN5hxyTXSVt8/YkhtxE0RPst8oEJzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034