UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YVZEywSgqWfGR+coe8WWJhELAcOFWnu6oOADW/Z/Y2E='
WHERE
key_id = 'e50bf22c188258998559bffbf4163b477fa897c421cc3442858d923a8a14017e'
AND (
token = 'YVZEywSgqWfGR+coe8WWJhELAcOFWnu6oOADW/Z/Y2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)