UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NpV0ZrQYj4cYwqeCEESHRJwki3dqIce1ijN7Yc/pL5M='
WHERE
key_id = '3223f24764afbd3eb150788b04115bdd02dded9c7e10ad84844f6e5ee6d64b37'
AND (
token = 'NpV0ZrQYj4cYwqeCEESHRJwki3dqIce1ijN7Yc/pL5M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)