UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hVU5TFsGz1iJAbX4MHeH+XAcuBEPsiXfwb/Jb70Ar5s='
WHERE
key_id = 'c3532b7b3b998e233bc795981b31995aecd7e57432b4b8f5f54ee88cfd752fe2'
AND (
token = 'hVU5TFsGz1iJAbX4MHeH+XAcuBEPsiXfwb/Jb70Ar5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)