UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nN0kgOuOQ6jw4k2je63glaQfJZRsZ90e3gNyoDioRJE=' 
WHERE 
  key_id = '10a881253eda712871619e4a7883ba91554fd0e95c1e26ec991b3721c6f66276' 
  AND (
    token = 'nN0kgOuOQ6jw4k2je63glaQfJZRsZ90e3gNyoDioRJE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035