UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cCpYxW7lmndqhIXEmYhBhV7W2hC6l/rub9WfJB9Utck='
WHERE
key_id = '4b4688ec68ad6fe90dcd382ca5ab6a8efd562bbe6a054d1ec2d48ffedb5c0b72'
AND (
token = 'cCpYxW7lmndqhIXEmYhBhV7W2hC6l/rub9WfJB9Utck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)