UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hu9i6FuNtQB1Q2kVAiWNVpEdKye9kz25jYqjQgBeoY4='
WHERE
key_id = '7a4726c7d329c866d4a3366c84e3ee87e58e2b30e1ab8a0bb71c1fdb73991c08'
AND (
token = 'hu9i6FuNtQB1Q2kVAiWNVpEdKye9kz25jYqjQgBeoY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)