UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5WsooWpkCTnAPu7+D1IuzkPrE8mdENbJzVCLnRncVDU=' 
WHERE 
  key_id = '5fdebcc221715c0679c8bedfdb44ecb3883ec1ef6114a79a8a3de9785f3bfce6' 
  AND (
    token = '5WsooWpkCTnAPu7+D1IuzkPrE8mdENbJzVCLnRncVDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037