UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mV4WZqaPPb8TjiIF+MiIC7w9USB1x6tGFimEov6RIk0=' 
WHERE 
  key_id = '6e8b4a30df22942953987a1f748750693d6aeb0540a15a8e9ec16db78cc8e13d' 
  AND (
    token = 'mV4WZqaPPb8TjiIF+MiIC7w9USB1x6tGFimEov6RIk0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022