UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ugNGggl3MVXJ62jxBZ24SRNZt011RC/rVJJwo3hQQ48='
WHERE
key_id = 'c6ec3f11aefe73062d1aa0f9670740ba2a51505f7ead8ce5e86dde8ddd89bc51'
AND (
token = 'ugNGggl3MVXJ62jxBZ24SRNZt011RC/rVJJwo3hQQ48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)