UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mv+TcfXj+XtwL9i5rzNQHONDpohTc3WIb5Bl3whYYHM='
WHERE
key_id = 'f3086be230a95258cf4ab2d6de6936a5f2eb5b4eb1e3f24695ed9c8f6867e27d'
AND (
token = 'Mv+TcfXj+XtwL9i5rzNQHONDpohTc3WIb5Bl3whYYHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)