UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aCHQAdLo2t8l0QmY0Ti8Hiku0TcBYyBT7z0/t5E0ku4='
WHERE
key_id = 'fa3dc804515b133e2c0616517d9e9dde648efbdf6d7963b4bc683369cff9b26e'
AND (
token = 'aCHQAdLo2t8l0QmY0Ti8Hiku0TcBYyBT7z0/t5E0ku4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)