UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3AWxhGhDYFFXi0FvMeYO/SNaydY40dmwoNuD7VQiCI0='
WHERE
key_id = '0b8f9e9da6d8b7cdb58529f399979c8ce1d789ae7a2ea1cfa27e8d44f40bd32a'
AND (
token = '3AWxhGhDYFFXi0FvMeYO/SNaydY40dmwoNuD7VQiCI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)