UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'urVv1PcIV04PupgeWJI/AtWvmeMnsSC4pJ2ij7Eardo=' 
WHERE 
  key_id = '51dc8038e4557b52bd3c175864d8335e6d7c0ceb9d6cc7209dfdacc79a5a6c78' 
  AND (
    token = 'urVv1PcIV04PupgeWJI/AtWvmeMnsSC4pJ2ij7Eardo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032