UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F2euTuSOs2ld5dbJ6yJlg1gUaBa8pb/n7NfxYQM+bY0='
WHERE
key_id = '45bb7db07b50a049833a86a867ff777a2cf1e4e782ca5a16246053545fc0f085'
AND (
token = 'F2euTuSOs2ld5dbJ6yJlg1gUaBa8pb/n7NfxYQM+bY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)