UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '201fmQdGuEM7c2LQFN7m0Lyh0oZLKm9f6fYgPZr+Kl0='
WHERE
key_id = 'db8506303737f55ce63d9f1f6c1fde1fa510c12091bcd933968f0ece231b380b'
AND (
token = '201fmQdGuEM7c2LQFN7m0Lyh0oZLKm9f6fYgPZr+Kl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)