UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9DiYK/bEfuNB4EijiMlAo66rTkFxLWBUnJnMwlmygfk='
WHERE
key_id = '88dec710b8fd1d16fb9494164ed68bf0b68b8704c823504663f6172e70df87dc'
AND (
token = '9DiYK/bEfuNB4EijiMlAo66rTkFxLWBUnJnMwlmygfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)