UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IpIbWbINkHruZAzoeWRXKaahK3XanRhtTs6q2sGK/hY='
WHERE
key_id = 'a77b70200184c599fc83cadad260512d31f9958545203cf3d81f6ce5c9914dde'
AND (
token = 'IpIbWbINkHruZAzoeWRXKaahK3XanRhtTs6q2sGK/hY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)