UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XDrZnWvnNQquso06X8c85VyzUmtZkaDKksHtfGdY7v8=' 
WHERE 
  key_id = 'fdb5111101b854ed9f1ca8a404aa1ea2fac42e48e4de34b12bc16609a6b44cd4' 
  AND (
    token = 'XDrZnWvnNQquso06X8c85VyzUmtZkaDKksHtfGdY7v8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048