UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WQcegL9QuNnmKZHnsBvQ+bGFz+awSc/otKnal0l+lJs='
WHERE
key_id = '897f478d3a54f29f6bdf9df35556e79a4fa51578a0198beadb30cdc132a5e2d9'
AND (
token = 'WQcegL9QuNnmKZHnsBvQ+bGFz+awSc/otKnal0l+lJs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)