UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ueECZ7uUiYVCqstY6g7AnDCTBj+p/njeajXqtF1VpA='
WHERE
key_id = 'c7d86c8bb5f9b5d3f1b1927a7cf0d84af86a41e4cb37f44df99342b0e16e4be3'
AND (
token = '9ueECZ7uUiYVCqstY6g7AnDCTBj+p/njeajXqtF1VpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)