UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F8fxojZjAngixJGMYESHaENOXeI3wQxv+IKwTumQoto=' 
WHERE 
  key_id = 'c68e7dd3659f5a79d8c2485d1d1e42810ac6ce1a2eeba8f7698113c411269f02' 
  AND (
    token = 'F8fxojZjAngixJGMYESHaENOXeI3wQxv+IKwTumQoto=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00078