UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WXgM76evgC56gZisP6Ybm2sHblyyFdXhwCTBZvbDKt8=' 
WHERE 
  key_id = '892304092f649b6929b67cdd25cf466124ee327d812ff3ec8d8ac6fb23fe589e' 
  AND (
    token = 'WXgM76evgC56gZisP6Ybm2sHblyyFdXhwCTBZvbDKt8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044