UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43yfUCK71mTrudJGUoECWKsSri7SbE4CmDr8Xn12T10='
WHERE
key_id = '7bd45f58a9473f21d8cb50284e5b713cd8dc08b5d185c1fcdd819085384e11f2'
AND (
token = '43yfUCK71mTrudJGUoECWKsSri7SbE4CmDr8Xn12T10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)