UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wel8zODnQxRNsRlrtArCihm8+bozzCfcYTmfHF4oKnI='
WHERE
key_id = '63c0f5c9bbeeb01970fe8278da5f938a1b540ea3878ee131c369abb0a7aee556'
AND (
token = 'wel8zODnQxRNsRlrtArCihm8+bozzCfcYTmfHF4oKnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)