UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1oA0QGkRslWVJGzVB6fSwoS653o0OSmigrHVgHwZIyQ='
WHERE
key_id = '43112dbb90c7625ef9383df659a6d5e919278a63dcef696622999dde0afd9f73'
AND (
token = '1oA0QGkRslWVJGzVB6fSwoS653o0OSmigrHVgHwZIyQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)