UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CpvrJ3Sj7zL/5uP0f8tG5q1xB32NQLDhQupdYNpDvaU='
WHERE
key_id = '64cf95df36e970e3ca8040c4a4df8b6a9875d58444ae089217226e9e57aba2a7'
AND (
token = 'CpvrJ3Sj7zL/5uP0f8tG5q1xB32NQLDhQupdYNpDvaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)