UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9wK69OdTkFHpQkBK93X9zmfZQOobwNelFpPn8ksfL0w='
WHERE
key_id = '887723c0658abfb80b35aeba89118f74b176dceeae7d7c95808fbecadbc8e715'
AND (
token = '9wK69OdTkFHpQkBK93X9zmfZQOobwNelFpPn8ksfL0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)