UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OpnDJISe6aYXWv131esxcwa7HR10SEa6B7H9iZrIaQU='
WHERE
key_id = '4de3e6307d9c3b0f029f9bba42d34d6de43a3cb19b5d6223175593563a24a6c3'
AND (
token = 'OpnDJISe6aYXWv131esxcwa7HR10SEa6B7H9iZrIaQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)