UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8NPv4zFaLhgs8xRdYwfHwwN4gb5dBrttcqfwE9W7RaU='
WHERE
key_id = 'e6f6a78aba3a047831caf17634c37fa78f26aaee968a7fd6e2c09f7bcf87cc98'
AND (
token = '8NPv4zFaLhgs8xRdYwfHwwN4gb5dBrttcqfwE9W7RaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)