UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zpNIk7RIRvAMAsgGIlEtUjjPgNZ2FXcwkyCgHrJ+yjg='
WHERE
key_id = '5d90e78506d1f596bc764127e1a2d43b5df28bdca23eae754c498bade1a03bcd'
AND (
token = 'zpNIk7RIRvAMAsgGIlEtUjjPgNZ2FXcwkyCgHrJ+yjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)