UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jcl5Lg28t79JK/a63b8RlBlziqlb6l8qBAOn1pkdGn4='
WHERE
key_id = 'a950ef996849bf782b347355ea563b2e2400383bc24915982ca93b0232fc993e'
AND (
token = 'Jcl5Lg28t79JK/a63b8RlBlziqlb6l8qBAOn1pkdGn4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)