UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yC0jpXffDryqZmkLTMJYKlT8+7AJC1PTD0Mr/NrXZrI='
WHERE
key_id = '05bc3da46e0460d64c1f94143df7592eedecad69ec80ab2036e4a75de3e6f1e8'
AND (
token = 'yC0jpXffDryqZmkLTMJYKlT8+7AJC1PTD0Mr/NrXZrI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)