UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eiy3pIqPKMMSkrUpA7bUv9Hpp5JyXpAKMfTGT5/Mr5E='
WHERE
key_id = 'c3e3751a5586de0b522511da804141ac20deab8690a743640469554191c92485'
AND (
token = 'eiy3pIqPKMMSkrUpA7bUv9Hpp5JyXpAKMfTGT5/Mr5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)