UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tsMVfdoKYK8KW4IA5RhWKTO5JjbdVFej89/kcTavNuo=' 
WHERE 
  key_id = '952432d177180f95d3ffdda4e3b8ce30378720e6a5af10fc6654f6a5a1e0c403' 
  AND (
    token = 'tsMVfdoKYK8KW4IA5RhWKTO5JjbdVFej89/kcTavNuo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022