UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'odxmAOJQOlXeN3/sDBwXQ7M7JvZqtUCauqJGoTvINDM='
WHERE
key_id = 'e57ffc03418d938f84f43003356ead781a7f99428af5e84830fd1a565efe90cf'
AND (
token = 'odxmAOJQOlXeN3/sDBwXQ7M7JvZqtUCauqJGoTvINDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)