UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+gXveF0j8PBFFHCkqJBk2FXQ9F7kVgyNfc3rOwqmJHM='
WHERE
key_id = 'd5289721c700a02fed18e81f36bea2583f0d0daefa30dacfb4659b3895109438'
AND (
token = '+gXveF0j8PBFFHCkqJBk2FXQ9F7kVgyNfc3rOwqmJHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)