UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'imxwhDnUMcC8aaaZv4hV+Sq01cSZlxOPvIpIFVDqvZY='
WHERE
key_id = '1da21ccac4e6e6f54c00b41f43ad736bb5f528df6586e1ff03c28a19f12c1c3e'
AND (
token = 'imxwhDnUMcC8aaaZv4hV+Sq01cSZlxOPvIpIFVDqvZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)