UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UJwwgSgTlcZvE4PiTEONvhdYvDqHboXRMX/wD6nl79s=' 
WHERE 
  key_id = 'c60ffaf8f5dac64882ed5e3e800ac5f386dbf97c1c0eb7bfeba788cb73eb6aad' 
  AND (
    token = 'UJwwgSgTlcZvE4PiTEONvhdYvDqHboXRMX/wD6nl79s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049