UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v1VshamPV6IVJGQ73XXSkRfJ3jsLWvMeTAnB3fbskQs=' 
WHERE 
  key_id = '13fe57fc7a48bd0e0076c227d4e8d335f53e2a2f8a3a6f1fdf068f8cf527ba64' 
  AND (
    token = 'v1VshamPV6IVJGQ73XXSkRfJ3jsLWvMeTAnB3fbskQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029