UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iGXT6dYGgWZMVVAY7fPChrFLvRfM785x88H3uJYy0Ww=' 
WHERE 
  key_id = '53a72c84ebc47936847fcc0eed7ac1d1037655909362a0ee24bd1935f17d67ef' 
  AND (
    token = 'iGXT6dYGgWZMVVAY7fPChrFLvRfM785x88H3uJYy0Ww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021