UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hig/s/SI3g9hPUa/AuuxkrdvxfKq7xPj8oZUEffcZ40='
WHERE
key_id = '99e47f59812df6406e63e2dc52a54d68db3e5522433fbeebf74a7f2a3dfc8d29'
AND (
token = 'hig/s/SI3g9hPUa/AuuxkrdvxfKq7xPj8oZUEffcZ40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)