UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ld5wPWl9r0XhN3IR0oZrd7Mz7aIbjXvnttPWDVWkHac='
WHERE
key_id = 'c66e52bba81401030aa04c0e08b9af9ad00e724f4f955c9e4ad29cdc1ab26475'
AND (
token = 'Ld5wPWl9r0XhN3IR0oZrd7Mz7aIbjXvnttPWDVWkHac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)