UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E9G0IDhFelUPTGzUkIZeK6Ga1czERL7wrRly/iUXiHM='
WHERE
key_id = '72f4ed77c8d82f743d982eeb2c8affbdf6129bdc41c88882643c3d94f3fb8aa0'
AND (
token = 'E9G0IDhFelUPTGzUkIZeK6Ga1czERL7wrRly/iUXiHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)