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