UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mMhlsXv7JHrUtYQi/xsFWRAyWGbknicjwS4u4VBiWnc='
WHERE
key_id = '6f638a723d54664ecccdac8c9a49868136fe93fa9bb131a53a01ef2ec45a77d9'
AND (
token = 'mMhlsXv7JHrUtYQi/xsFWRAyWGbknicjwS4u4VBiWnc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)