UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '98S+PXdszdDI1B7DOl6W7BbK1jolqqR92JGLLA5i8AA='
WHERE
key_id = 'ffbcbb65c5f0e9c8934ddc875385b0b5580212a8a6a6fda6ccb3eab71e1108d7'
AND (
token = '98S+PXdszdDI1B7DOl6W7BbK1jolqqR92JGLLA5i8AA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)