UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OzsMEWyEa5QdD4xdFk3t7xluaGK3zeWcY4LJ4oRcgR8=' 
WHERE 
  key_id = '899e6bd08f8bc1e337cb825c381643fa71bfeb886ad0acaeb41c93d4cf9603a3' 
  AND (
    token = 'OzsMEWyEa5QdD4xdFk3t7xluaGK3zeWcY4LJ4oRcgR8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034