UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Y4+oTST9Ze8iWv8GGViVBe9ciB0bS73kv5ApZt/z8w=' 
WHERE 
  key_id = '67c18da166c85d6fe86cf1b61e769dbb4f717534b73d8d7c9868b475e6cc0427' 
  AND (
    token = '+Y4+oTST9Ze8iWv8GGViVBe9ciB0bS73kv5ApZt/z8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060