UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CIjl4idhy0/UmHBNP0u5FUqyoVOXL3GvHWRc5v157iU='
WHERE
key_id = 'c106491a67a77bb31a9a78734fc80964ec9a9173bed8874ab7e9220efca3bd56'
AND (
token = 'CIjl4idhy0/UmHBNP0u5FUqyoVOXL3GvHWRc5v157iU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)