UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LJjPoIxPSTpzVov9SdedVUYO8lNCCQjPbc5PdXuFUtA=' 
WHERE 
  key_id = '41f68ca9b56d57ce62a64cf6192413496e555ee0df1d767fc9f7e50e22328005' 
  AND (
    token = 'LJjPoIxPSTpzVov9SdedVUYO8lNCCQjPbc5PdXuFUtA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055